Bin Function
Returns the binary version of the number passed as a String.
Syntax
result = Bin( value )
Parameters | ||
value |
The number to be converted to binary. |
Notes
If the value is not a whole number, the decimal part will be truncated.
You can specify binary, hex, or octal numbers by preceding the number with the & symbol and the letter that indicates the number base. The letter b indicates binary, h indicates hex, and o indicates octal.
Examples
Below are examples of various numbers converted to binary:
Dim binVersion As String
binVersion=Bin (15) //returns "1111"
binVersion=Bin(15.5) //returns "1111"
binVersion=Bin(75) //returns "1001011"
binVersion=Bin( &hF) //returns "1111"
binVersion=Bin (15) //returns "1111"
binVersion=Bin(15.5) //returns "1111"
binVersion=Bin(75) //returns "1001011"
binVersion=Bin( &hF) //returns "1111"
See Also